package com.gupaoedu.task.pattern.prototype.originalcode;

/**
 * @author djl
 * @Title: Resume
 * @Description: TODO
 * @date 2019/3/30
 */
public class Resume  implements Cloneable{

    private String name;
    private String sex;
    private String age;
    private String timeArea;
    private String company;
    private WorkExperience work;
    public Resume(String name)
    {
        this.name = name;
        work = new WorkExperience();
    }
    private Resume(WorkExperience work) throws CloneNotSupportedException
    {
        this.work = (WorkExperience)work.Clone();
    }
    //设置个人信息
    public void SetPersonalInfo(String sex, String age)
    {
        this.sex = sex;
        this.age = age;
    }

    //设置工作经历
/*    public void SetWorkExperience(String timeArea, String company)
    {
        this.timeArea = timeArea;
        this.company = company;
    }*/
    //设置工作经历
    public void SetWorkExperience(String workDate, String company)
    {
        work.setWorkDate(workDate);
        work.setCompany(company);
    }

    //显示
    public void Display()
    {
        System.out.println(name+" "+sex+" "+age);
        //System.out.println(timeArea+" "+company);
        System.out.println(work.getWorkDate()+" "+work.getCompany());
    }

    public Object Clone() throws CloneNotSupportedException
    {
        //return (Object)super.clone();
        Resume obj = new Resume(this.work);

        obj.name = this.name;
        obj.sex = this.sex;
        obj.age = this.age;

        return obj;
    }
}
